package com.groupname.dangerousdelves;

import sofia.graphics.Color;
import sofia.graphics.RectangleShape;
import android.graphics.RectF;

// -------------------------------------------------------------------------
/**
 *  Write a one-sentence summary of your class here.
 *  Follow it with additional details about its purpose, what abstraction
 *  it represents, and how to use it.
 *
 *  @author Chris
 *  @version Dec 1, 2012
 */
public class MovableTile
     implements Tile
{
    private Actor occupant;
    private RectangleShape tile;

    private RectF location;

    // ----------------------------------------------------------
    /**
     * Create a new DungeonTile object.
     */
    public MovableTile(RectF newLocation)
    {
        this.location = newLocation;
        this.tile = new RectangleShape(newLocation);
        this.tile.setColor(Color.black);
        this.tile.setFillColor(Color.beige);
        this.tile.setFilled(true);
    }

    public boolean isMovable()
    {
        return true;
    }

    public void setOccupant(Actor actor)
    {
        this.occupant = actor;

        this.tile.setFillColor(this.occupant.getColor());
        this.tile.setFilled(true);
    }

    public void removeOccupant()
    {
        this.occupant = null;
        this.tile.setFillColor(Color.beige);
    }

    public Actor getOccupant()
    {
        return this.occupant;
    }

    public RectangleShape getShape()
    {
        return tile;
    }
}
